package tesis.ProyectoFianl.Logica;

import java.util.ArrayList;

import android.content.Context;

import tesis.ProyectoFianl.Datos.DBDaoHospital;
import tesis.ProyectoFianl.Entidades.Hospital;
import tesis.ProyectoFianl.Interfaces.IDaoHospital;

public class DAOHospital implements IDaoHospital 
{
	Context context;
	public DAOHospital(Context ctx)
	{
		this.context = ctx;
	}
	
	
	@Override
	public void insert(Hospital hospital) 
	{
		DBDaoHospital dbDaoHospital = new DBDaoHospital(this.context);
		dbDaoHospital.insert(hospital);		
	}

	
	@Override
	public void update(Hospital hospital) 
	{
		DBDaoHospital dbDaoHospital = new DBDaoHospital(this.context);
		dbDaoHospital.update(hospital);		
	}

	
	@Override
	public void delete(Hospital hospital) 
	{
		DBDaoHospital dbDaoHospital = new DBDaoHospital(this.context);
		dbDaoHospital.delete(hospital);
	}

	
	@Override
	public Hospital getHospital(int idHospital) 
	{
		DBDaoHospital dbDaoHospital = new DBDaoHospital(this.context);
		Hospital hospital = dbDaoHospital.getHospital(idHospital);
		return hospital;
	}

	
	@Override
	public ArrayList<Hospital> getHospital() 
	{
		DBDaoHospital dbDaoHospital = new DBDaoHospital(this.context);
		ArrayList<Hospital> hospitalList = dbDaoHospital.getHospital();
		return hospitalList;
	}

	
	@Override
	public Hospital getHospital(String nombre) 
	{
		DBDaoHospital dbDaoHospital = new DBDaoHospital(this.context);
		Hospital hospital = dbDaoHospital.getHospital(nombre);
		return hospital;
	}
}
